package org.gd.hellojavacore.tests;

import java.util.*;
import java.util.concurrent.ConcurrentHashMap;

public class MapTest {

    public static void main(String...str) {

        Map<String, String> map = new TreeMap<String, String>();
        map.put("k1", "v1");
        map.put("k2", "v2");
        map.put("k3", "v3");
        map.put("k4", "v4");
        map.put("k5", "v5");
        map.put("k6", "v6");
        map.put("k7", "v7");
        /*
        for(Map.Entry<String, String> m: map.entrySet()) {
            System.out.println(m.getKey() + ": " + m.getValue());
            if(m.getKey().contains("k2")) {
                map.remove(m.getKey());
            }
        }
        */
        System.out.println();
        for(Map.Entry<String, String> m: map.entrySet()) {
            System.out.println(m.getKey() + ": " + m.getValue());
        }

    }
}
